﻿using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Mvc.Infrastructure;
using Microsoft.Extensions.DependencyInjection;
using MyFramework.Web.Api;
using System.Collections.Generic;

namespace MyFramework.Plugins.Core.Extensions
{
    /// <summary>
    /// 
    /// </summary>
    public static class MyPluginFrameworkStartupExtensions
    {
        /// <summary>
        /// 添加插件功能
        /// </summary>
        /// <param name="services"></param>
        public static void AddMyPluginFramework(this IServiceCollection services)
        {
            // 用于添加插件Controller 时，通知Controller.Action发生变化
            services.AddSingleton<IActionDescriptorChangeProvider>(MyActionDescriptorChangeProvider.Instance);
            services.AddSingleton(MyActionDescriptorChangeProvider.Instance);
            //注入插件管理
            services.AddTransient<MyPluginManager>();
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="app"></param>
        public static void UseMyPlugin(this IApplicationBuilder app)
        {

        }

    }
}
